package nl.saxion.ami;

import org.restlet.resource.ServerResource;
import nl.saxion.ami.Sensor;
import com.google.gson.*;

public class RESTLETResource extends ServerResource implements SensorResource{

	@Override
	public String retrieve() {
		int sensorid = Integer.parseInt((String)getRequest().getAttributes().get("sensorid"));
		Sensor sensor = SensorwaardeDAO.getLaatsteWaarde(sensorid);
		Gson json = new Gson();
		String retVal = json.toJson(sensor);
		return retVal;
	}
}
